/*
 * 日志消息类
 *
*/

#ifndef __MESSAGE_H__
#define __MESSAGE_H__
#include <iostream>
#include <string>
#include <thread>
#include "level.hpp"
#include "util.hpp"

namespace mylog{
  struct LogMsg{
     time_t _ctime;  //日志时间
     size_t _line;  //行号
     std::string _file; //日志名称
     mylog::LogLevel::value _level; //日志等级
     std::string _payload; //主体消息
     std::string _name;  //日志器名字
     std::thread::id _tid; //线程id

     LogMsg(size_t line,mylog::LogLevel::value level,std::string file,const std::string &name,
            std::string &&msg):
         _ctime(mylog::Util::Date::getTime()),
         _line(line),
         _file(file),
         _level(level),
         _payload(std::move(msg)),
         _name(name),
         _tid(std::this_thread::get_id()){}
   }; 
}
#endif
